const App = () => {
  const niubiHandler = (event) => {
    event.preventDefault(); // 阻止标签默认行为
    event.stopPropagation() // 阻止冒泡
    console.log(event);
    // 获取事件对象
    alert("超牛逼");
  };

  return (
    <div onClick={niubiHandler} style={{width: 200, height: 200, backgroundColor: "pink"}}>
      <button onClick={niubiHandler}>牛逼</button>
      <a href="https://www.baidu.com" onClick={niubiHandler}>
        去百度
      </a>
    </div>
  );
};
export default App;
